<script setup lang="ts">
import { zhCN, dateZhCN } from 'naive-ui'

onMounted(() => {
  const startClientMatch = () => {
    // 适配终端
    const _GXResizeEvent = () => {
      const nDefault_width = 1920
      const nDefault_height = 1080
      const nClient_width = document.documentElement.clientWidth
      const nClient_height = document.documentElement.clientHeight
      const nAuot_width = nClient_width / nDefault_width
      const nAuot_height = nClient_height / nDefault_height
      const jNodeBody: HTMLElement = document.getElementById('app') || document.createElement('div')
      jNodeBody.style.transformOrigin = `0% 0% 0`
      jNodeBody.style.transform = `scale(${nAuot_width},${nAuot_height})`
    }

    window.onresize = () => {
      _GXResizeEvent()
    }
    window.addEventListener('resize', _GXResizeEvent, false)
    window.addEventListener('load', _GXResizeEvent, false)
  }
  // startClientMatch()
})
</script>

<template>
  <n-config-provider :locale="zhCN" :date-locale="dateZhCN">
    <n-loading-bar-provider>
      <n-dialog-provider>
        <n-notification-provider>
          <n-message-provider>
            <GlobalContainer></GlobalContainer>
          </n-message-provider>
        </n-notification-provider>
      </n-dialog-provider>
    </n-loading-bar-provider>
  </n-config-provider>
</template>

<style scoped></style>
